unit UfrmNovoObjeto;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, UfrmKernel_Base, ActnList, ImgList, JvExControls, JvXPCore,
  JvXPButtons, Buttons, jpeg, ExtCtrls, StdCtrls;

type
  TfrmNovoObjeto = class(TfrmKernel_Base)
    PnTitle: TPanel;
    LbTitle1: TLabel;
    LbTitle2: TLabel;
    Image1: TImage;
    Panel2: TPanel;
    BtnRefresh: TSpeedButton;
    Panel7: TPanel;
    btnGerarProjeto: TJvXPButton;
    ilNovoObjs: TImageList;
    actlstNovoObjs: TActionList;
    actSair: TAction;
    Panel1: TPanel;
    edtNOME_OBJ: TEdit;
    Label1: TLabel;
    edtFKTABLE_OBJS: TEdit;
    Label2: TLabel;
    edtTITULO_OBJS: TEdit;
    Label3: TLabel;
    actGerarOBjeto: TAction;
    JvXPButton1: TJvXPButton;
    procedure actGerarOBjetoExecute(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmNovoObjeto: TfrmNovoObjeto;

implementation

uses UKernel_Exception, UKernel_Mensagem;

{$R *.dfm}

procedure TfrmNovoObjeto.actGerarOBjetoExecute(Sender: TObject);
begin
  inherited;
  if edtNOME_OBJ.text = ''  then
    begin
      edtNOME_OBJ.SetFocus;
      raise Livre_Mensagem_Global.CreateFmt(Kernel_Aviso_CampoObrigatorio + '  %s  ',['( Tabela ) )']);
    end;

  if edtFKTABLE_OBJS.text = ''  then
    begin
      edtFKTABLE_OBJS.SetFocus;
      raise Livre_Mensagem_Global.CreateFmt(Kernel_Aviso_CampoObrigatorio + '  %s  ',['( Campo Chave ) )']);
    end;

  if edtTITULO_OBJS.text = ''  then
    begin
      edtTITULO_OBJS.SetFocus;
      raise Livre_Mensagem_Global.CreateFmt(Kernel_Aviso_CampoObrigatorio + '  %s  ',['( Titulo do Cadastro ) )']);
    end;

  ModalResult := mrOk;
end;

procedure TfrmNovoObjeto.FormShow(Sender: TObject);
begin
  inherited;
  edtNOME_OBJ.setfocus;
end;

end.
